<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools"></t:base>
<html>
	<head>
		<style>
			.examTitle{
				text-align: center;
    			font-size: 25px;
    			font-weight: bold;
    			height: 50px;
    			line-height: 50px;
    			margin-top: 10px;
			}
			.subTitle{
				border-bottom:1px dashed gray;
				text-align: center;
				height:30px;
				line-height: 30px;
				font-size:14px;
			}
			.examScoreBar{
				font-size:18px;			
				padding:10px;
					
			}
			.errorRow{
				background-color: #ff5200;
				color: white;
			}
			.detailTable{
				border-collapse: collapse;
				margin-left:10px;
			}
			.detailTable td{
				border:1px solid #ddd;
				padding:5px 10px;
			}
			
			.score{
				font-size:25px;
				font-weight: bold;
			}
			
			.detailBar{
				padding-left:10px;
			}
			
			.tHeader td{
				background-color: #ccc;
				color:black;
				text-align: center;
			}
		</style>
	</head>
	<body>
		<h1 class="examTitle">安全准入在线考试结果</h1>
		<div class="subTitle">答题人：${result.user.realName} &nbsp;
			开始时间：<fmt:formatDate value="${result.beginDate }"/>&nbsp;
			结束时间：<fmt:formatDate value="${result.endDate }"/>
		</div>
		
		<div class="examScoreBar">
			考试分数：
			<c:choose>
				<c:when test="${result.examScore >= 80}">
					<span class="score" style="color:green">${result.examScore}</span>
				</c:when>
				<c:otherwise>
					<span class="score" style="color:red">${result.examScore}</span>
				</c:otherwise>
			</c:choose>
		</div>
				
		<div class="detailBar">
			答题明细信息：
		</div>
		<table class="detailTable">
			<tr class="tHeader">
				<td>题目</td><td>选项A</td><td>选项B</td><td>选项C</td><td>选项D</td><td>正确答案</td><td>学生答案</td><td>结果</td>
			</tr>
			<c:forEach items="${items}" var="i">
				<c:choose>
					<c:when test="${i.answerResult ==1 }">
						<tr class="rigthRow">
							<td>${i.title }</td><td>${i.option1}</td><td>${i.option2}</td>
							<td>${i.option3}</td><td>${i.option4}</td>
							<td>${i.answer }</td><td>${i.userAnswer }</td>
							<td>正确</td>
						</tr>
					</c:when>
					<c:otherwise>
						<tr class="errorRow">
							<td>${i.title }</td><td>${i.option1}</td><td>${i.option2}</td>
							<td>${i.option3}</td><td>${i.option4}</td>
							<td>${i.answer }</td><td>${i.userAnswer }</td>
							<td>错误</td>
						</tr>
					</c:otherwise>
				</c:choose>				
			</c:forEach>
		</table> 
		
	</body>
	

</html>

 